package com.github.sort;

public class sort {
    public static void main(String[] args){
        DataType[] R=new DataType[10];
       int[] key=new int[]{6,5,4,3,9,8,1,2,7,0};
       String[] data=new String[]{"a","b","c","d","e","f","g","h","i","j"};
        for (int i = 0; i < R.length; i++) {
            DataType<String> Rdata=new DataType<String>();
            Rdata.key= key[i];
            Rdata.data=data[i];
            R[i]=Rdata;
        }
       QuickSort.quickSort(R);
        for (DataType s:R) {
            System.out.println(""+s.key+":"+s.data);
        }
    }
}
class DataType<V>implements Comparable<DataType>{
    public int key;
    public V data;

    @Override
    public int compareTo(DataType o) {
        if (this.key>o.key)return 1;
        if (this.key<o.key)return -1;
        return 0;
    }
}
